home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
pertab
/
perftab.bas
< prev
next >
Wrap
BASIC Source File
|
1995-09-07
|
5KB
|
187 lines
' =====================================
' PerfectTAB 1.0 (Freeware)
' =====================================
' Copyright (C) 1994 by
' bytes & letters,
' hilger software technology
' postfach 16 27
' 66716 Saarlouis, germany
' written by Dirk Hilger
'=======================================
Type tabbedDialogType
Sheet_Distance As Integer
Loop_Distance As Integer
loop_sheet_distance As Integer
Active_Yadd As Integer
loops_per_group As Integer
active_bevelWidth As Integer
inactive_bevelwidth As Integer
label_position As Integer
active_Sheet As Integer
init As Integer
picHeight As Integer
picwidth As Integer
sheetheight As Integer
sheetwidth As Integer
count As Integer
oldsy As Integer
oldly As Integer
actsy As Integer
actly As Integer
BevelWidth As Integer
End Type
Private Sub tab_getLocalPos (ByVal oWidth%, ByVal oHeight%, ByVal iWidth%, ByVal iHeight%, ByVal p%, putLeft%, putTop%)
If p% = 1 Or p% = 4 Or p% = 7 Then
putLeft% = (oWidth% - iWidth%) \ 2
ElseIf p% = 0 Or p% = 3 Or p% = 6 Then
putLeft% = 3
Else
putLeft% = oWidth% - iWidth% - 3
End If
If p% < 3 Then
putTop% = 3
ElseIf p% < 6 Then
putTop% = (oHeight% - iHeight%) \ 2
Else
putTop% = oHeight% - iHeight% - 3
End If
End Sub
Sub Tab_SetActive (f As Form, s As tabbedDialogType, ByVal n%)
Dim i%, lx%, ly%, sx%, sy%, t%, oldscalemode%, lasttab%
Dim labelwidth%, labelheight%, p%
lasttab% = s.active_Sheet
On Local Error Resume Next
oldscalemode% = f.ScaleMode
f.ScaleMode = 3
If s.oldsy% Then
If s.init% = True And lasttab% = n% Then Exit Sub
If n% < 0 Then
n% = s.count%
ElseIf n% > s.count% Then
n% = 0
End If
f.Tab_sheet(lasttab%).Enabled = False
f.Tab_sheet(lasttab%).BevelWidth = s.inactive_bevelwidth
f.Tab_Label(lasttab%).FontBold = False
f.Tab_sheet(lasttab%).Top = s.oldsy%
f.Tab_Loop(lasttab%).Top = s.oldly%
f.Tab_Loop(lasttab%).Picture = f.Tab_Loop_Picture(1).Picture
End If
If s.init% = False Then
s.init% = True
s.count% = 100
If s.loops_per_group = 0 Then
s_loops_per_group = 100
End If
s.picHeight% = f.Tab_Loop_Picture(1).Height
s.picwidth% = f.Tab_Loop_Picture(1).Width - 2
lx% = f.Tab_Loop(0).Left
ly% = f.Tab_Loop(0).Top
sx% = lx%
f.Tab_sheet(0).Left = sx%
sy% = ly% + s.picHeight% + s.loop_sheet_distance
f.Tab_sheet(0).Top = sy%
s.sheetwidth% = f.Tab_sheet(0).Width
s.sheetheight% = f.Tab_sheet(0).Height
s.actsy% = sy% + s.Active_Yadd
s.actly% = ly% + s.Active_Yadd
For i% = 0 To s.count%
f.Tab_Loop(i%).ScaleMode = 3
If Err Then
s.count% = i% - 1
Exit For
End If
f.Tab_Loop(i%).BorderStyle = 0
f.Tab_Loop(i%).AutoSize = True
tab_getLocalPos s.picwidth, s.picHeight, f.Tab_Label(i%).Width, f.Tab_Label(i%).Height, s.label_position, l%, t%
f.Tab_Label(i%).Left = l%
f.Tab_Label(i%).Top = t%
If i% Then
f.Tab_Loop(i%).Left = lx%
f.Tab_Loop(i%).Top = ly%
f.Tab_sheet(i%).Left = sx%
f.Tab_sheet(i%).Top = sy%
f.Tab_sheet(i%).Width = s.sheetwidth%
f.Tab_sheet(i%).Height = s.sheetheight%
End If
If i% <> n% Then
f.Tab_Loop(i%).Picture = f.Tab_Loop_Picture(1).Picture
f.Tab_sheet(i%).BevelWidth = s.inactive_bevelwidth
f.Tab_sheet(i%).Enabled = False
f.Tab_Label(i%).FontBold = False
End If
lx% = lx% + s.picwidth% + s.Loop_Distance
ly% = ly% + s.Sheet_Distance
sx% = sx% - s.Sheet_Distance
sy% = sy% + s.Sheet_Distance
If (i% + 1) Mod s.loops_per_group = 0 Then
lx% = sx%
End If
Next
End If
GoSub tab_setSheet_stack
lasttab% = n%
s.oldsy% = f.Tab_sheet(lasttab%).Top
s.oldly% = f.Tab_Loop(lasttab%).Top
f.Tab_sheet(lasttab%).Top = s.actsy%
f.Tab_Loop(lasttab%).Top = s.actly%
f.Tab_sheet(lasttab%).Enabled = True
f.Tab_sheet(lasttab%).BevelWidth = s.active_bevelWidth
f.Tab_Label(lasttab%).FontBold = True
f.Tab_Loop(lasttab%).Picture = f.Tab_Loop_Picture(0).Picture
f.Tab_sheet(lasttab%).ZOrder 0
f.Tab_Loop(lasttab%).ZOrder 0
ScaleMode = oldscalemode%
s.active_Sheet = lasttab%
Exit Sub
tab_setSheet_stack:
For i% = 0 To s.count%
If i% <> n% Then
f.Tab_Loop(i%).ZOrder 1
f.Tab_sheet(i%).ZOrder 1
End If
f.Tab_Label(i%).BorderStyle = 0
Next
Return
End Sub